﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HeresyManager.Comunication;

public partial class Controls_EnterStringControl : System.Web.UI.UserControl
{
    private EnterStringComunicator enterString;



    public EnterStringComunicator EnterString
    {
        get { return enterString; }
        set { enterString = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (enterString != null)
        {
            this.Label1.Text = enterString.Question;
            //TextBox1.Text = enterString.Answer;
        }
    }


    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
        TextBox1.TextChanged+=new EventHandler(TextBox1_TextChanged);
    }

    protected void TextBox1_TextChanged(object sender, EventArgs e)
    {
        enterString.Answer = TextBox1.Text;// (sender as TextBox).Text;
    }
}